package com.web.comment.po;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.*;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.LazyToOne;
import org.hibernate.annotations.LazyToOneOption;

import com.web.hotel.po.Hotel;
import com.web.system.po.UserPo;

@Entity
@Table(name = "t_comment")
public class CommentPo implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6946141164424096226L;
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY) 
	private Integer commentId;
	private String commentContext;
	private Date createTime;
	
	@ManyToOne
	@JoinColumn(name = "userId")
	@Fetch(value = FetchMode.SELECT)
	@LazyToOne(value = LazyToOneOption.PROXY)
	private UserPo user;
	
	@ManyToOne
	@JoinColumn(name = "hotelId")
	@Fetch(value = FetchMode.SELECT)
	@LazyToOne(value = LazyToOneOption.PROXY)
	private Hotel hotel;
	
	public Integer getCommentId() {
		return commentId;
	}
	public void setCommentId(Integer commentId) {
		this.commentId = commentId;
	}
	
	public String getCommentContext() {
		return commentContext;
	}
	public void setCommentContext(String commentContext) {
		this.commentContext = commentContext;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public UserPo getUser() {
		return user;
	}
	public void setUser(UserPo user) {
		this.user = user;
	}
	public Hotel getHotel() {
		return hotel;
	}
	public void setHotel(Hotel hotel) {
		this.hotel = hotel;
	}
	
}
